<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/styles/qstyleoption.cpp -->
<head>
  <title>Qt 4.3: QStyleOptionTabV2 Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QStyleOptionTabV2 Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QStyleOptionTabV2 class is used to describe the parameters necessary for drawing a tabs in Qt 4.1 or above. <a href="#details">More...</a></p>
<pre> #include &lt;QStyleOptionTabV2&gt;</pre><p>Inherits <a href="qstyleoptiontab.html">QStyleOptionTab</a>.</p>
<p>This class was introduced in Qt 4.1.</p>
<ul>
<li><a href="qstyleoptiontabv2-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qstyleoptiontabv2.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qstyleoptiontabv2.html#QStyleOptionTabV2">QStyleOptionTabV2</a></b> ()</li>
<li><div class="fn"/><b><a href="qstyleoptiontabv2.html#QStyleOptionTabV2-2">QStyleOptionTabV2</a></b> ( const QStyleOptionTabV2 &amp; <i>other</i> )</li>
<li><div class="fn"/><b><a href="qstyleoptiontabv2.html#QStyleOptionTabV2-3">QStyleOptionTabV2</a></b> ( const QStyleOptionTab &amp; <i>other</i> )</li>
<li><div class="fn"/>QStyleOptionTabV2 &amp; <b><a href="qstyleoptiontabv2.html#operator-eq">operator=</a></b> ( const QStyleOptionTab &amp; <i>other</i> )</li>
</ul>
<ul>
<li><div class="fn"/>2 public functions inherited from <a href="qstyleoption.html#public-functions">QStyleOption</a></li>
</ul>
<a name="public-variables"></a>
<h3>Public Variables</h3>
<ul>
<li><div class="fn"/>QSize <b><a href="qstyleoptiontabv2.html#iconSize-var">iconSize</a></b></li>
</ul>
<ul>
<li><div class="fn"/>7 public variables inherited from <a href="qstyleoptiontab.html#public-variables">QStyleOptionTab</a></li>
<li><div class="fn"/>7 public variables inherited from <a href="qstyleoption.html#public-variables">QStyleOption</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QStyleOptionTabV2 class is used to describe the parameters necessary for drawing a tabs in Qt 4.1 or above.</p>
<p>An instance of the QStyleOptionTabV2 class has type <a href="qstyleoption.html#OptionType-enum">SO_Tab</a> and <a href="qstyleoption.html#version-var">version</a> 2. The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to determine the type of style option. In general you do not need to worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own styles. The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you normally don't need to check it.</p>
<p>If you create your own <a href="qstyle.html">QStyle</a> subclass, you should handle both <a href="qstyleoptiontab.html">QStyleOptionTab</a> and QStyleOptionTabV2. One way to achieve this is to use the QStyleOptionTabV2 copy constructor. For example:</p>
<pre>     if (const QStyleOptionTab *tabOption =
            qstyleoption_cast&lt;const QStyleOptionTab *&gt;(option)) {
         QStyleOptionTabV2 tabV2(*tabOption);

         <span class="comment">//</span> draw the tab using tabV2
    }</pre>
<p>In the example above: If <tt>tabOption</tt>'s version is 1, the extra member (<a href="qstyleoptiontabv2.html#iconSize-var">iconSize</a>) will be set to an invalid size for <tt>tabV2</tt>. If <tt>tabOption</tt>'s version is 2, the constructor will simply copy the <tt>tab</tt>'s <a href="qstyleoptiontabv2.html#iconSize-var">iconSize</a>.</p>
<p>For an example demonstrating how style options can be used, see the <a href="widgets-styles.html">Styles</a> example.</p>
<p>See also <a href="qstyleoptiontab.html">QStyleOptionTab</a> and <a href="qstyleoption.html">QStyleOption</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="StyleOptionVersion-enum"></a>enum QStyleOptionTabV2::StyleOptionVersion</h3>
<p>This enum is used to hold information about the version of the style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QStyleOptionTabV2::Version</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">2</td></tr>
</table></p>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you normally don't need to check it.</p>
<p>See also <a href="qstyleoptiontab.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QStyleOptionTabV2"></a>QStyleOptionTabV2::QStyleOptionTabV2 ()</h3>
<p>Constructs a <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a>.</p>
<h3 class="fn"><a name="QStyleOptionTabV2-2"></a>QStyleOptionTabV2::QStyleOptionTabV2 ( const QStyleOptionTabV2 &amp; <i>other</i> )</h3>
<p>Constructs a copy of the <i>other</i> style option.</p>
<h3 class="fn"><a name="QStyleOptionTabV2-3"></a>QStyleOptionTabV2::QStyleOptionTabV2 ( const <a href="qstyleoptiontab.html">QStyleOptionTab</a> &amp; <i>other</i> )</h3>
<p>Constructs a <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a> copy of the <i>other</i> style option which can be either of the <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a> or <a href="qstyleoptiontab.html">QStyleOptionTab</a> types.</p>
<p>If the other style option's version is 1, the new style option's <tt>iconSize</tt> is set to an invalid value. If its version is 2, its <tt>iconSize</tt> value is simply copied to the new style option.</p>
<h3 class="fn"><a name="operator-eq"></a>QStyleOptionTabV2 &amp; QStyleOptionTabV2::operator= ( const <a href="qstyleoptiontab.html">QStyleOptionTab</a> &amp; <i>other</i> )</h3>
<p>Assigns the <i>other</i> style option to this <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a>. The <i>other</i> style option can be either of the <a href="qstyleoptiontabv2.html">QStyleOptionTabV2</a> or <a href="qstyleoptiontab.html">QStyleOptionTab</a> types.</p>
<p>If the other style option's version is 1, this style option's <tt>iconSize</tt> is set to an invalid size. If its version is 2, its <tt>iconSize</tt> value is simply copied to this style option.</p>
<hr />
<h2>Member Variable Documentation</h2>
<h3 class="fn"><a name="iconSize-var"></a><a href="qsize.html">QSize</a> QStyleOptionTabV2::iconSize</h3>
<p>This variable holds the size for the icons.</p>
<p>The default value is <a href="qsize.html">QSize</a>(-1, -1), i.e&#x2e; an invalid size; use <a href="qstyle.html#pixelMetric">QStyle::pixelMetric</a>() to find the default icon size for tab bars.</p>
<p>See also <a href="qtabbar.html#iconSize-prop">QTabBar::iconSize</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
